package edu.sjtu.context.prob;

import edu.sjtu.context.core.LocalContextChangeListener;

/**
 * Interface of local context probes. Each local probe must implement this interface.
 * The probe will be initialized by {@link ContextManager}, the ContextManager will 
 * create a Thread for each prob.
 * @author Roger
 *
 */
public interface LocalContextProb extends Runnable {
	/**
	 * Add local context change listener to the probe.
	 * @param lis
	 * 		listener to be added.
	 */
	public void addLocalContextChangeListener(LocalContextChangeListener lis);
	
	/**
	 * remove local context change listener from the probe.
	 * @param lis
	 * 		listener to be removed.
	 * @return
	 * 		the index of the listener which will be removed in the probe's listener list. 
	 */
	public int removeLocalContextChangeListener(LocalContextChangeListener lis);
	
	/**
	 * get detection frequency.
	 * @return
	 * 		detection frequency.
	 */	
	public long getFrequency();
	
	/**
	 * set detection frequency.
	 * @param frequency
	 * 		detection frequency.
	 */
	public void setFrequency(long frequency);
}
